package cn.sciento.starter.tenant.custom.core;

import org.springframework.beans.factory.FactoryBean;

public class DynamicTenantCustomFactoryBean implements FactoryBean<Object> {
  private Class<?> proxyInterface;
  
  private String[] proxyBeanNames;
  
  public Object getObject() throws Exception {
    return DynamicTenantCustomBeanProxyFactory.createCustomBeanProxy(this.proxyInterface, this.proxyBeanNames);
  }
  
  public Class<?> getObjectType() {
    return this.proxyInterface;
  }
  
  public boolean isSingleton() {
    return true;
  }
  
  public DynamicTenantCustomFactoryBean(Class<?> proxyInterface, String[] proxyBeanNames) {
    this.proxyInterface = proxyInterface;
    this.proxyBeanNames = proxyBeanNames;
  }
}
